<include file="Public:head" title='文章详情' />
<script src="__PUBLIC__/js/other/validate.js"></script>
<script>
    $(function() {
        $("#form").validate({
            errorPlacement: function(error, element) {
                var error_td = element.parent('td');
                error_td.find('label.error').hide();
                error_td.append(error);
            },
            rules: {
                title: {
                    required: true
                },
                pid: {
                    required: true
                }
            },
            messages: {
                title: {
                    required: "标题不能为空"
                },
                pid: {
                    required: "请选择文章分类"
                }
            }
        });
        $.getScript("__PUBLIC__/js/plugins/kind2/kindeditor-min.js", function() {
            KindEditor.basePath = '__PUBLIC__/js/plugins/kind2/';
            KindEditor.create('textarea[id="content"]');
        });
    })
</script>
<div class="main-container" id="main-container">
    <div class="main-container-inner">
        <include file="Public:left" />
        <div class="main-content">
            <div class="breadcrumbs" id="breadcrumbs">
                <ul class="breadcrumb">
                    <li><i class="icon-home home-icon"></i><a href="__APP__/{$Think.MODULE_NAME}">首页</a></li>
                    <li><a href="{:U('Article/lists')}">文章管理</a></li>
                    <li class="active">文章{$Think.get.id|getPageType}</li>
                </ul>
            </div>
            <div class="page-content">
                <div class="row">
                    <div class="col-xs-12">
                        <div class="row">
                            <div class="col-xs-12">
                                <h3 class="header smaller lighter blue">文章{$Think.get.id|getPageType}</h3>

                                <form action="{:U('Article/detail_post')}" method="POST" id="form">
                                    <table class="table table_detail">
                                        <tbody>
                                            <tr>
                                                <td class="td_left">文章标题:</td>
                                                <td>
                                                    <input name="title" type="text" class="common_txt"  value="{$detail.title}" autocomplete="off"/>
                                                </td>
                                            </tr>
<tr>
                                                <td class="td_left">代码:</td>
                                                <td>
                                                    <input name="code" type="text" class="common_txt"  value="{$detail.code}" autocomplete="off"/>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="td_left">文章分类:</td>
                                                <td>
                                                    <select name="pid" id="pid" autocomplete="off">
                                                        <foreach name="cats" item="row">
                                                            <option value="{$row.id}"<if condition="$row.id eq $detail['pid']">selected</if>
                                                            <if condition="$row.type eq 1">disabled="true"</if>>
                                                            {$row.title}                                                
                                                            </option>
                                                            <foreach name="row['sub']" item="row2">
                                                                <option value="{$row2.id}" <if condition="$row2.id eq $detail['pid']">selected</if>>
                                                                &nbsp;&nbsp;&nbsp;&nbsp;{$row2.title}</option>
                                                            </foreach>
                                                        </foreach>
                                                    </select>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="td_left">内容</td>
                                                <td>
                                                    <textarea id="content" name="content" rows="25" cols="80">{$detail.content}</textarea>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="td_left">排序:</td>
                                                <td>
                                                    <input name="ord" type="text" class="common_txt" value="{$detail.ord}" />
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="td_left">关键字:</td>
                                                <td>
                                                    <input name="keywords" type="text" class="common_txt" value="{$detail.keywords}" />
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="td_left">描述:</td>
                                                <td>
                                                    <textarea name="description" cols="60" rows="5">{$detail.description}</textarea>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="td_left"></td>
                                                <td>
                                                    <input type='hidden' name='id' value='{$Think.get.id}'/>
                                                    <button class="btn btn-info btn-sm" type="submit">
                                                        <i class="icon-ok bigger-110 "></i>
                                                        保 存
                                                    </button>
                                                    <button class="btn btn-sm reset" type="button" onclick="goUrl(-1)">
                                                        <i class="icon-undo bigger-110"></i>
                                                        返 回
                                                    </button>
                                                </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <include file="Public:setting" />
    </div>
</div>
<include file="Public:foot" />